import { Base } from '../../../utils/base.js';

class Detail extends Base {
  constructor() {
    super();
  }
  getProductDetail(goodsId,callback) {
    var that = this;
    var params = {
      url: 'product/' + goodsId,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(params);
  }
  getIsStock(id,callback)
  {
    var that=this;
    var params = {
      url: 'specifi/' + id,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(params);
  }
  AddCart(carData,callback)
  {
    var that = this;
    var params = {
      url: 'cart/data',
      type: 'post',
      data: carData,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(params);
  }
  createOrder(cartData,callback)
  {
    console.log(cartData);
    var that = this;
    var params = {
      url: 'OrderCreate',
      type: 'post',
      data: cartData,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(params);
  }
};

export { Detail };